import java.awt.Color;
import java.awt.Graphics;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JPanel;

class View extends JPanel implements Observer {

	Model_Model model;

	View(Model_Model model) {
		this.model = model;

	}

	@Override
	public void paint(Graphics g) {

		g.setColor(Color.WHITE);
		g.fillRect(0, 0, getWidth(), getHeight());
		g.setColor(Color.MAGENTA);
		g.fillOval(model.getX(), model.getY(), model.BALL_SIZE, model.BALL_SIZE);

	}

	@Override
	public void update(Observable obs, Object agr) {
		repaint();
	}
}
